home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Misc Servers / Zope.exe / DATETIME.PY < prev    next >
Encoding:
Text File  |  2000-10-31  |  25.6 KB  |  830 lines

  1. ##############################################################################
  2. # Zope Public License (ZPL) Version 1.0
  3. # -------------------------------------
  4. # Copyright (c) Digital Creations.  All rights reserved.
  5. # This license has been certified as Open Source(tm).
  6. # Redistribution and use in source and binary forms, with or without
  7. # modification, are permitted provided that the following conditions are
  8. # met:
  9. # 1. Redistributions in source code must retain the above copyright
  10. #    notice, this list of conditions, and the following disclaimer.
  11. # 2. Redistributions in binary form must reproduce the above copyright
  12. #    notice, this list of conditions, and the following disclaimer in
  13. #    the documentation and/or other materials provided with the
  14. #    distribution.
  15. # 3. Digital Creations requests that attribution be given to Zope
  16. #    in any manner possible. Zope includes a "Powered by Zope"
  17. #    button that is installed by default. While it is not a license
  18. #    violation to remove this button, it is requested that the
  19. #    attribution remain. A significant investment has been put
  20. #    into Zope, and this effort will continue if the Zope community
  21. #    continues to grow. This is one way to assure that growth.
  22. # 4. All advertising materials and documentation mentioning
  23. #    features derived from or use of this software must display
  24. #    the following acknowledgement:
  25. #      "This product includes software developed by Digital Creations
  26. #      for use in the Z Object Publishing Environment
  27. #      (http://www.zope.org/)."
  28. #    In the event that the product being advertised includes an
  29. #    intact Zope distribution (with copyright and license included)
  30. #    then this clause is waived.
  31. # 5. Names associated with Zope or Digital Creations must not be used to
  32. #    endorse or promote products derived from this software without
  33. #    prior written permission from Digital Creations.
  34. # 6. Modified redistributions of any form whatsoever must retain
  35. #    the following acknowledgment:
  36. #      "This product includes software developed by Digital Creations
  37. #      for use in the Z Object Publishing Environment
  38. #      (http://www.zope.org/)."
  39. #    Intact (re-)distributions of any official Zope release do not
  40. #    require an external acknowledgement.
  41. # 7. Modifications are encouraged but must be packaged separately as
  42. #    patches to official Zope releases.  Distributions that do not
  43. #    clearly separate the patches from the original work must be clearly
  44. #    labeled as unofficial distributions.  Modifications which do not
  45. #    carry the name Zope may be packaged in any form, as long as they
  46. #    conform to all of the clauses above.
  47. # Disclaimer
  48. #   THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS ``AS IS'' AND ANY
  49. #   EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  50. #   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  51. #   PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DIGITAL CREATIONS OR ITS
  52. #   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  53. #   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  54. #   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  55. #   USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  56. #   ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  57. #   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  58. #   OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  59. #   SUCH DAMAGE.
  60. # This software consists of contributions made by Digital Creations and
  61. # many individuals on behalf of Digital Creations.  Specific
  62. # attributions are listed in the accompanying credits file.
  63. ##############################################################################
  64.  
  65.  
  66. class DateTime:
  67.  
  68.     """
  69.     The DateTime object provides an interface for working with dates
  70.     and times in various formats.  DateTime also provides methods for
  71.     calendar operations, date and time arithmetic and formatting.
  72.  
  73.     DateTime objects represent instants in time and provide
  74.     interfaces for controlling its representation without
  75.     affecting the absolute value of the object. 
  76.  
  77.     DateTime objects may be created from a wide variety of string 
  78.     or numeric data, or may be computed from other DateTime objects.
  79.     DateTimes support the ability to convert their representations
  80.     to many major timezones, as well as the ability to create a
  81.     DateTime object in the context of a given timezone.
  82.  
  83.     DateTime objects provide partial numerical behavior:
  84.  
  85.       - Two date-time objects can be subtracted to obtain a time,
  86.         in days between the two.
  87.  
  88.       - A date-time object and a positive or negative number may
  89.         be added to obtain a new date-time object that is the given
  90.         number of days later than the input date-time object.
  91.  
  92.       - A positive or negative number and a date-time object may
  93.         be added to obtain a new date-time object that is the given
  94.         number of days later than the input date-time object.
  95.  
  96.       - A positive or negative number may be subtracted from a
  97.         date-time object to obtain a new date-time object that is
  98.         the given number of days earlier than the input date-time
  99.         object.
  100.  
  101.     DateTime objects may be converted to integer, long, or float
  102.     numbers of days since January 1, 1901, using the standard int, 
  103.     long, and float functions (Compatibility Note: int, long and
  104.     float return the number of days since 1901 in GMT rather than
  105.     local machine timezone). DateTime objects also provide access
  106.     to their value in a float format usable with the python time
  107.     module, provided that the value of the object falls in the
  108.     range of the epoch-based time module.
  109.  
  110.     A DateTime object should be considered immutable; all conversion
  111.     and numeric operations return a new DateTime object rather than
  112.     modify the current object.
  113.  
  114.     Return a new date-time object
  115.  
  116.     A DateTime object always maintains its value as an absolute 
  117.     UTC time, and is represented in the context of some timezone
  118.     based on the arguments used to create the object. A DateTime
  119.     object's methods return values based on the timezone context.
  120.  
  121.     Note that in all cases the local machine timezone is used for
  122.     representation if no timezone is specified.
  123.  
  124.     DateTimes may be created with from zero to seven arguments.
  125.  
  126.  
  127.       - If the function is called with no arguments, then the 
  128.         current date/time is returned, represented in the 
  129.         timezone of the local machine.
  130.  
  131.       - If the function is invoked with a single string argument
  132.         which is a recognized timezone name, an object representing
  133.         the current time is returned, represented in the specified
  134.         timezone.
  135.  
  136.       - If the function is invoked with a single string argument
  137.         representing a valid date/time, an object representing
  138.         that date/time will be returned.
  139.  
  140.         As a general rule, any date-time representation that is 
  141.         recognized and unambiguous to a resident of North America is
  142.         acceptable.(The reason for this qualification is that
  143.         in North America, a date like: 2/1/1994 is interpreted
  144.         as February 1, 1994, while in some parts of the world,
  145.         it is interpreted as January 2, 1994.) A date/time
  146.         string consists of two components, a date component and
  147.         an optional time component, separated by one or more
  148.         spaces. If the time component is omitted, 12:00am is
  149.         assumed. Any recognized timezone name specified as the
  150.         final element of the date/time string will be used for
  151.         computing the date/time value. (If you create a DateTime
  152.         with the string 'Mar 9, 1997 1:45pm US/Pacific', the
  153.         value will essentially be the same as if you had captured
  154.         time.time() at the specified date and time on a machine in
  155.         that timezone)::
  156.  
  157.           e=DateTime("US/Eastern")
  158.           # returns current date/time, represented in US/Eastern.
  159.  
  160.           x=DateTime("1997/3/9 1:45pm")
  161.           # returns specified time, represented in local machine zone.
  162.  
  163.           y=DateTime("Mar 9, 1997 13:45:00")
  164.           # y is equal to x
  165.  
  166.  
  167.         The date component consists of year, month, and day
  168.         values. The year value must be a one-, two-, or
  169.         four-digit integer. If a one- or two-digit year is
  170.         used, the year is assumed to be in the twentieth
  171.         century. The month may an integer, from 1 to 12, a
  172.         month name, or a month abbreviation, where a period may
  173.         optionally follow the abbreviation. The day must be an
  174.         integer from 1 to the number of days in the month. The
  175.         year, month, and day values may be separated by
  176.         periods, hyphens, forward, slashes, or spaces. Extra
  177.         spaces are permitted around the delimiters. Year,
  178.         month, and day values may be given in any order as long
  179.         as it is possible to distinguish the components. If all
  180.         three components are numbers that are less than 13,
  181.         then a a month-day-year ordering is assumed.
  182.  
  183.         The time component consists of hour, minute, and second
  184.         values separated by colons.  The hour value must be an
  185.         integer between 0 and 23 inclusively. The minute value
  186.         must be an integer between 0 and 59 inclusively. The
  187.         second value may be an integer value between 0 and
  188.         59.999 inclusively. The second value or both the minute
  189.         and second values may be omitted. The time may be
  190.         followed by am or pm in upper or lower case, in which
  191.         case a 12-hour clock is assumed.
  192.  
  193.       - If the DateTime function is invoked with a single
  194.         Numeric argument, the number is assumed to be 
  195.         a floating point value such as that returned by 
  196.         time.time().
  197.  
  198.         A DateTime object is returned that represents 
  199.         the gmt value of the time.time() float represented in
  200.         the local machine's timezone.
  201.  
  202.       - If the function is invoked with two numeric arguments,
  203.         then the first is taken to be an integer year and the
  204.         second argument is taken to be an offset in days from
  205.         the beginning of the year, in the context of the local
  206.         machine timezone.
  207.         The date-time value returned is the given offset number of 
  208.         days from the beginning of the given year, represented in
  209.         the timezone of the local machine. The offset may be positive
  210.         or negative.
  211.         Two-digit years are assumed to be in the twentieth
  212.         century.
  213.  
  214.       - If the function is invoked with two arguments, the first
  215.         a float representing a number of seconds past the epoch
  216.         in gmt (such as those returned by time.time()) and the 
  217.         second a string naming a recognized timezone, a DateTime
  218.         with a value of that gmt time will be returned, represented
  219.         in the given timezone.::
  220.  
  221.           import time
  222.           t=time.time()
  223.  
  224.           now_east=DateTime(t,'US/Eastern')
  225.           # Time t represented as US/Eastern
  226.  
  227.           now_west=DateTime(t,'US/Pacific')
  228.           # Time t represented as US/Pacific
  229.  
  230.           # now_east == now_west
  231.           # only their representations are different
  232.  
  233.  
  234.  
  235.       - If the function is invoked with three or more numeric
  236.         arguments, then the first is taken to be an integer
  237.         year, the second is taken to be an integer month, and
  238.         the third is taken to be an integer day. If the
  239.         combination of values is not valid, then a
  240.         DateTimeError is raised. Two-digit years are assumed
  241.         to be in the twentieth century. The fourth, fifth, and
  242.         sixth arguments specify a time in hours, minutes, and
  243.         seconds; hours and minutes should be positive integers
  244.         and seconds is a positive floating point value, all of
  245.         these default to zero if not given. An optional string may
  246.         be given as the final argument to indicate timezone (the
  247.         effect of this is as if you had taken the value of time.time()
  248.         at that time on a machine in the specified timezone).
  249.  
  250.     If a string argument passed to the DateTime constructor cannot be
  251.     parsed, it will raise DateTime.SyntaxError. Invalid date, time, or
  252.     timezone components will raise a DateTime.DateTimeError. 
  253.  
  254.     The module function Timezones() will return a list of the 
  255.     timezones recognized by the DateTime module. Recognition of 
  256.     timezone names is case-insensitive.
  257.  
  258.     """
  259.  
  260.  
  261.     def timeTime():
  262.         """
  263.         Return the date/time as a floating-point number in UTC, in the
  264.         format used by the python time module.  Note that it is
  265.         possible to create date/time values with DateTime that have no
  266.         meaningful value to the time module.
  267.  
  268.         Permission -- Always available
  269.         """
  270.  
  271.     def toZone(z):
  272.         """
  273.         Return a DateTime with the value as the current object,
  274.         represented in the indicated timezone.
  275.  
  276.         Permission -- Always available
  277.         """
  278.  
  279.     def isFuture():
  280.         """
  281.         Return true if this object represents a date/time later than
  282.         the time of the call
  283.  
  284.         Permission -- Always available
  285.         """
  286.  
  287.     def isPast():
  288.         """
  289.         Return true if this object represents a date/time earlier than
  290.         the time of the call
  291.  
  292.         Permission -- Always available
  293.         """
  294.  
  295.     def isCurrentYear():
  296.         """
  297.         Return true if this object represents a date/time that falls
  298.         within the current year, in the context of this object\'s
  299.         timezone representation
  300.  
  301.         Permission -- Always available
  302.         """
  303.  
  304.     def isCurrentMonth():
  305.         """
  306.         Return true if this object represents a date/time that falls
  307.         within the current month, in the context of this object\'s
  308.         timezone representation
  309.  
  310.         Permission -- Always available
  311.         """
  312.  
  313.     def isCurrentDay():
  314.         """
  315.         Return true if this object represents a date/time that falls
  316.         within the current day, in the context of this object\'s
  317.         timezone representation
  318.  
  319.         Permission -- Always available
  320.         """
  321.  
  322.     def isCurrentHour():
  323.         """
  324.         Return true if this object represents a date/time that falls
  325.         within the current hour, in the context of this object\'s
  326.         timezone representation
  327.  
  328.         Permission -- Always available
  329.         """
  330.  
  331.     def isCurrentMinute():
  332.         """
  333.         Return true if this object represents a date/time that falls
  334.         within the current minute, in the context of this object\'s
  335.         timezone representation
  336.  
  337.         Permission -- Always available
  338.         """
  339.  
  340.     def earliestTime():
  341.         """
  342.         Return a new DateTime object that represents the earliest
  343.         possible time (in whole seconds) that still falls within the
  344.         current object's day, in the object's timezone context
  345.  
  346.         Permission -- Always available
  347.         """
  348.  
  349.     def latestTime():
  350.         """
  351.         Return a new DateTime object that represents the latest
  352.         possible time (in whole seconds) that still falls within the
  353.         current object's day, in the object's timezone context
  354.  
  355.         Permission -- Always available
  356.         """
  357.  
  358.     def greaterThan(self,t):
  359.         """
  360.         Compare this DateTime object to another DateTime object OR a
  361.         floating point number such as that which is returned by the
  362.         python time module. Returns true if the object represents a
  363.         date/time greater than the specified DateTime or time module
  364.         style time.  Revised to give more correct results through
  365.         comparison of long integer milliseconds.
  366.  
  367.         Permission -- Always available
  368.         """
  369.  
  370.     def greaterThanEqualTo(self,t):
  371.         """
  372.         Compare this DateTime object to another DateTime object OR a
  373.         floating point number such as that which is returned by the
  374.         python time module. Returns true if the object represents a
  375.         date/time greater than or equal to the specified DateTime or
  376.         time module style time.  Revised to give more correct results
  377.         through comparison of long integer milliseconds.
  378.  
  379.         Permission -- Always available
  380.         """
  381.  
  382.     def equalTo(self,t):
  383.         """
  384.         Compare this DateTime object to another DateTime object OR a
  385.         floating point number such as that which is returned by the
  386.         python time module. Returns true if the object represents a
  387.         date/time equal to the specified DateTime or time module style
  388.         time.  Revised to give more correct results through comparison
  389.         of long integer milliseconds.
  390.  
  391.         Permission -- Always available
  392.         """
  393.  
  394.     def notEqualTo(self,t):
  395.         """
  396.         Compare this DateTime object to another DateTime object OR a
  397.         floating point number such as that which is returned by the
  398.         python time module. Returns true if the object represents a
  399.         date/time not equal to the specified DateTime or time module
  400.         style time.  Revised to give more correct results through
  401.         comparison of long integer milliseconds.
  402.  
  403.         Permission -- Always available
  404.         """
  405.  
  406.     def lessThan(self,t):
  407.         """
  408.         Compare this DateTime object to another DateTime object OR a
  409.         floating point number such as that which is returned by the
  410.         python time module. Returns true if the object represents a
  411.         date/time less than the specified DateTime or time module
  412.         style time.  Revised to give more correct results through
  413.         comparison of long integer milliseconds.
  414.  
  415.         Permission -- Always available
  416.         """
  417.  
  418.     def lessThanEqualTo(self,t):
  419.         """
  420.         Compare this DateTime object to another DateTime object OR a
  421.         floating point number such as that which is returned by the
  422.         python time module. Returns true if the object represents a
  423.         date/time less than or equal to the specified DateTime or time
  424.         module style time.  Revised to give more correct results
  425.         through comparison of long integer milliseconds.
  426.  
  427.         Permission -- Always available
  428.         """
  429.  
  430.     def isLeapYear():
  431.         """
  432.         Return true if the current year (in the context of the
  433.         object's timezone) is a leap year
  434.  
  435.         Permission -- Always available
  436.         """
  437.  
  438.     def dayOfYear():
  439.         """
  440.         Return the day of the year, in context of the timezone
  441.         representation of the object
  442.  
  443.         Permission -- Always available
  444.         """
  445.  
  446.     # Component access
  447.     def parts():
  448.         """
  449.         Return a tuple containing the calendar year, month, day, hour,
  450.         minute second and timezone of the object
  451.  
  452.         Permission -- Always available
  453.         """
  454.  
  455.     def timezone():
  456.         """
  457.         Return the timezone in which the object is represented.
  458.  
  459.         Permission -- Always available
  460.         """
  461.  
  462.     def year():
  463.         """
  464.         Return the calendar year of the object
  465.  
  466.         Permission -- Always available
  467.         """
  468.  
  469.     def month():
  470.         """
  471.         Return the month of the object as an integer
  472.  
  473.         Permission -- Always available
  474.         """
  475.  
  476.  
  477.     def Month():
  478.         """
  479.         Return the full month name
  480.  
  481.         Permission -- Always available
  482.         """
  483.  
  484.  
  485.     def aMonth():
  486.         """
  487.         Return the abbreviated month name.
  488.  
  489.         Permission -- Always available
  490.         """
  491.  
  492.  
  493.     def Mon():
  494.         """
  495.         Compatibility: see aMonth
  496.  
  497.         Permission -- Always available
  498.         """
  499.  
  500.  
  501.     def pMonth():
  502.         """
  503.         Return the abbreviated (with period) month name.
  504.  
  505.         Permission -- Always available
  506.         """
  507.  
  508.  
  509.     def Mon_():
  510.         """
  511.         Compatibility: see pMonth
  512.  
  513.         Permission -- Always available
  514.         """
  515.  
  516.  
  517.     def day():
  518.         """
  519.         Return the integer day
  520.  
  521.         Permission -- Always available
  522.         """
  523.  
  524.  
  525.     def Day(): 
  526.         """
  527.         Return the full name of the day of the week
  528.  
  529.         Permission -- Always available
  530.         """
  531.  
  532.  
  533.     def DayOfWeek():
  534.         """
  535.         Compatibility: see Day
  536.  
  537.         Permission -- Always available
  538.         """
  539.  
  540.  
  541.     def aDay():
  542.         """
  543.         Return the abbreviated name of the day of the week
  544.  
  545.         Permission -- Always available
  546.         """
  547.  
  548.     def pDay():
  549.         """
  550.         Return the abbreviated (with period) name of the day of the
  551.         week
  552.  
  553.         Permission -- Always available
  554.         """
  555.  
  556.     def Day_():
  557.         """
  558.         Compatibility: see pDay
  559.  
  560.         Permission -- Always available
  561.         """
  562.  
  563.     def dow():
  564.         """
  565.         Return the integer day of the week, where Sunday is 0
  566.  
  567.         Permission -- Always available
  568.         """
  569.  
  570.     def dow_1():
  571.         """
  572.         Return the integer day of the week, where Sunday is 1
  573.  
  574.         Permission -- Always available
  575.         """
  576.  
  577.  
  578.     def h_12():
  579.         """
  580.         Return the 12-hour clock representation of the hour
  581.  
  582.         Permission -- Always available
  583.         """
  584.  
  585.  
  586.     def h_24():
  587.         """
  588.         Return the 24-hour clock representation of the hour
  589.  
  590.         Permission -- Always available
  591.         """
  592.  
  593.  
  594.     def ampm():
  595.         """
  596.         Return the appropriate time modifier (am or pm)
  597.  
  598.         Permission -- Always available
  599.         """
  600.  
  601.  
  602.     def hour():
  603.         """
  604.         Return the 24-hour clock representation of the hour
  605.  
  606.         Permission -- Always available
  607.         """
  608.  
  609.  
  610.     def minute():
  611.         """
  612.         Return the minute
  613.  
  614.         Permission -- Always available
  615.         """
  616.  
  617.  
  618.     def second():
  619.         """
  620.         Return the second
  621.  
  622.         Permission -- Always available
  623.         """
  624.  
  625.  
  626.     def millis():
  627.         """
  628.         Return the millisecond since the epoch in GMT.
  629.  
  630.         Permission -- Always available
  631.         """
  632.  
  633.     def strftime(format):
  634.         """
  635.  
  636.         Return date time string formatted according to 'format'
  637.  
  638.         See Python's
  639.         "time.strftime":http://www.python.org/doc/current/lib/module-time.html
  640.         function.
  641.         """
  642.  
  643.     # General formats from previous DateTime
  644.     def Date():
  645.         """
  646.         Return the date string for the object.
  647.  
  648.         Permission -- Always available
  649.         """
  650.  
  651.     def Time():
  652.         """
  653.         Return the time string for an object to the nearest second.
  654.  
  655.         Permission -- Always available
  656.         """
  657.  
  658.     def TimeMinutes(): 
  659.         """
  660.         Return the time string for an object not showing seconds.
  661.  
  662.         Permission -- Always available
  663.         """
  664.  
  665.     def AMPM():
  666.         """
  667.         Return the time string for an object to the nearest second.
  668.  
  669.         Permission -- Always available
  670.         """
  671.  
  672.  
  673.     def AMPMMinutes():
  674.         """
  675.         Return the time string for an object not showing seconds.
  676.  
  677.         Permission -- Always available
  678.         """
  679.  
  680.     def PreciseTime():
  681.         """
  682.         Return the time string for the object.
  683.  
  684.         Permission -- Always available
  685.         """
  686.  
  687.     def PreciseAMPM():
  688.         """
  689.         Return the time string for the object.
  690.  
  691.         Permission -- Always available
  692.         """
  693.  
  694.     def yy():
  695.         """
  696.         Return calendar year as a 2 digit string
  697.  
  698.         Permission -- Always available
  699.         """
  700.  
  701.     def mm():
  702.         """
  703.         Return month as a 2 digit string
  704.  
  705.         Permission -- Always available
  706.         """
  707.  
  708.     def dd():
  709.         """
  710.         Return day as a 2 digit string
  711.  
  712.         Permission -- Always available
  713.         """
  714.  
  715.     def rfc822():
  716.         """
  717.         Return the date in RFC 822 format
  718.  
  719.         Permission -- Always available
  720.         """
  721.  
  722.     # New formats
  723.     def fCommon():
  724.         """
  725.         Return a string representing the object's value
  726.         in the format: March 1, 1997 1:45 pm
  727.  
  728.         Permission -- Always available
  729.         """
  730.  
  731.     def fCommonZ():
  732.         """
  733.         Return a string representing the object's value
  734.         in the format: March 1, 1997 1:45 pm US/Eastern
  735.  
  736.         Permission -- Always available
  737.         """
  738.  
  739.     def aCommon():
  740.         """
  741.         Return a string representing the object's value
  742.         in the format: Mar 1, 1997 1:45 pm
  743.  
  744.         Permission -- Always available
  745.         """
  746.  
  747.     def aCommonZ():
  748.         """
  749.         Return a string representing the object's value
  750.         in the format: Mar 1, 1997 1:45 pm US/Eastern
  751.  
  752.         Permission -- Always available
  753.         """
  754.  
  755.     def pCommon():
  756.         """
  757.         Return a string representing the object's value
  758.         in the format: Mar. 1, 1997 1:45 pm
  759.  
  760.         Permission -- Always available
  761.         """
  762.  
  763.     def pCommonZ():
  764.         """
  765.         Return a string representing the object's value
  766.         in the format: Mar. 1, 1997 1:45 pm US/Eastern
  767.  
  768.         Permission -- Always available
  769.         """
  770.  
  771.  
  772.     def ISO():
  773.         """
  774.         Return the object in ISO standard format
  775.  
  776.         Dates are output as: YYYY-MM-DD HH:MM:SS
  777.  
  778.         Permission -- Always available
  779.         """
  780.  
  781.     def HTML4():
  782.         """
  783.         Return the object in the format used in the HTML4.0 specification,
  784.         one of the standard forms in ISO8601.
  785.  
  786.         See "HTML 4.0 Specification":http://www.w3.org/TR/NOTE-datetime
  787.  
  788.         Dates are output as: YYYY-MM-DDTHH:MM:SSZ
  789.         T, Z are literal characters.
  790.         The time is in UTC.
  791.  
  792.         Permission -- Always available
  793.         """
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.